﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace MTS
{
    public class TileImage : IComparable<TileImage>
    {
        public enum TileType {TERRAIN, HEIGHTMAP, OBLIQUE, ISOMETRIC}

        private byte[] image;
        private long worldX, worldY;
        private TileType type;
        private int width, height;

        public TileImage(byte[] image, long worldX, long worldY, int width, int height, TileType type)
        {
            this.image = image;
            this.worldX = worldX;
            this.worldY = worldY;
            this.type = type;
            this.width = width;
            this.height = height;
        }

        public long getX()
        {
            return this.worldX;
        }

        public long getY()
        {
            return this.worldY;
        }

        public TileType getTileType()
        {
            return this.type;
        }

        public byte[] getImage()
        {
            return this.image;
        }

        public int getWidth()
        {
            return this.width;
        }

        public int getHeight()
        {
            return this.height;
        }

        public int CompareTo(TileImage other)
        {
            int yComp = worldY.CompareTo(other.getY());
            if (yComp != 0)
            {
                return yComp;
            }
            else
            {
                return worldX.CompareTo(other.getX());
            }
        }

        
    }
}
